package com.ruoyi.parkingcar.controller;


import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.parkingcar.domain.ParkWallet;
import com.ruoyi.parkingcar.service.ParkWalletService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/parkingcar/Wallet")
public class ParkWalletController {

    @Autowired
    private ParkWalletService parkWalletService;

    //查询充值记录
    @RequestMapping("/list")
    public ParkWallet select(ParkWallet parkWallet) {
        return parkWalletService.select(parkWallet);
    }

    //余额支付
    @PostMapping("/outMoney")
    public AjaxResult outMoney(@RequestBody ParkWallet parkWallet) {
        parkWalletService.countMoney(parkWallet);
        return AjaxResult.success("计算完成");
    }


}
